package com.dao;

import com.domain.Good;
import com.domain.Travel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.*;

@Repository
public interface TravelDao {

    @Select("SELECT * FROM travel")
    List<Travel> findAllTravel();

    @Select("SELECT * FROM travel WHERE travelid=#{travelid}")
    Travel getOneTravel(Integer travelid);

    @Select("SELECT * FROM good WHERE cid=#{cid}")
    List<Good> findGoodByType(Good good);

    @Insert("INSERT INTO travel(title,text,userid) VALUES(#{title},#{title},#{userid})")
    Integer addOneTravel(Travel travel);
}
